﻿@{
    string pointId = ViewBag.pointId;

}
<div class="module-container">
    <div class="search-panel">
        <form class="form-inline search-table">
            <div class="form-group">
                <select id="PointID" class="form-control uiselect uiselectsubmit" name="PointID"
                        data-has-text-field="false">
                    @Html.CheckPointsCategoryOption(pointId)
                </select>
            </div>
            <div class="form-group">
                <select id="CreateId" class="form-control uiselect uiselectsubmit" name="CreateId"
                        data-has-text-field="true"
                        data-width="100"></select>
            </div>
            <div class="form-group">
                <input class="form-control w150px" name="name" type="text"
                       placeholder="请输入手机\部门查询">
            </div>
            <button class="btn btn-primary" type="submit">
                <i class="fa fa-search"></i> 查询
            </button>

        </form>
    </div>
    <div class="uitable" data-url="@Url.Action("Grid",new {PointID = pointId })">
        @Html.Action("Grid", new { PointID = pointId })
    </div>
</div>
<script>
    $("#PointID").on("change", function (e) {
        showPointID();
    });
    function showPointID()
    {
        var PointID = $("#PointID").val();
        if (PointID == null || PointID == undefined || PointID.replace(/(^\s*)|(\s*$)/g, "").length == 0) {
            $('#CreateId').empty();
            $('#CreateId').append($('<option></option>').val('0').text('请选择稽查点'));
        }
        else {
            $.getJSON('@Url.Action("GetPointName", "AccountLog")', { PointID: PointID }, function (data) {
                $('#CreateId').empty();
                $('#CreateId').append($('<option></option>').val('0').text('全部'));
                $.each(data, function (i, item) {
                    $('#CreateId').append($('<option></option>').val(item.Value).text(item.Text));
                });
            });
        }
    }
    showPointID();
</script>